﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AutoMapper;
using Treinamento2015_01.Models;
using Treinamento2015_01Core.Models;

namespace Treinamento2015_01.App_Start
{
    public class MapperConfig
    {
        public static void StartMapper()
        {
            Mapper.CreateMap<Manufacturer, ManufacturerViewModel>();

            Mapper.CreateMap<ManufacturerViewModel, Manufacturer>();

            Mapper.CreateMap<ProductViewModel, Product>().ForMember(p => p.Price, s => s.Ignore());

            Mapper.CreateMap<Product, ProductViewModel>();

            Mapper.CreateMap<ProductType, ProductTypeViewModel>();

            Mapper.CreateMap<ProductTypeViewModel, ProductType>();

            Mapper.CreateMap<Stock, StockViewModel>();

            Mapper.CreateMap<StockViewModel, Stock>();
        }
    }
}

